﻿<UserControl x:Class="Starehe.Views.ViewExamResults"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d"
             d:DesignHeight="700" d:DesignWidth="984"
             Background="White">
    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Starehe;component/ModelsDataTemplates.xaml" />
                <ResourceDictionary Source="/Helper;component/Styles/ResultsDataGrid.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    <Grid>
        <TextBlock HorizontalAlignment="Left" Margin="20,20,0,0" Style="{DynamicResource Title}"  Text="View Exam Results" 
                   VerticalAlignment="Top"/>
        <RadioButton x:Name="rb1" Content="One Student" HorizontalAlignment="Left" Margin="40,80,0,0" VerticalAlignment="Top"
                     IsChecked="{Binding IsInStudentMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" 
                     GroupName="1"/>

        <TextBlock HorizontalAlignment="Left" Margin="50,130,0,0" Text="Student ID" VerticalAlignment="Top"/>

        <TextBox HorizontalAlignment="Left" Height="23" Margin="114,130,0,0" VerticalAlignment="Top" Width="200"
                 Text="{Binding SelectedStudentID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                 IsEnabled="{Binding IsInStudentMode}"/>
        <TextBlock HorizontalAlignment="Left" Margin="78,185,0,0" Text="Exam" VerticalAlignment="Top"/>
        <ComboBox x:Name="what" HorizontalAlignment="Left" Margin="114,185,0,0" VerticalAlignment="Top" Width="180"
                  ItemsSource="{Binding AllExams}" DisplayMemberPath="NameOfExam" 
                  SelectedValuePath="ExamID"
                  SelectedItem="{Binding SelectedExam, Mode=TwoWay}"
                  IsEnabled="{Binding IsInStudentMode}"/>
                
        <RadioButton Content="Class" HorizontalAlignment="Left" Margin="40,250,0,0" VerticalAlignment="Top"
                     IsChecked="{Binding IsInClassMode, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                     GroupName="1"/>
        <TextBlock HorizontalAlignment="Left" Margin="79,300,0,0" Text="Class" VerticalAlignment="Top"/>
        <ComboBox HorizontalAlignment="Left" Margin="114,300,0,0" VerticalAlignment="Top" Width="200"
                  ItemsSource="{Binding AllClasses}" DisplayMemberPath="NameOfClass"
                  SelectedValuePath="ClassID"
                  SelectedValue="{Binding SelectedClassID}"
                  IsEnabled="{Binding IsInClassMode}"/>
        <TextBlock HorizontalAlignment="Left" Margin="78,355,0,0" Text="Exam" VerticalAlignment="Top"/>
        <ComboBox HorizontalAlignment="Left" Margin="114,355,0,0" VerticalAlignment="Top" Width="180"
        	ItemsSource="{Binding AllExams}" DisplayMemberPath="NameOfExam" 
        	SelectedValuePath="ExamID"
        	SelectedItem="{Binding SelectedExam, Mode=TwoWay}"
            IsEnabled="{Binding IsInClassMode}"/>
        <TextBlock HorizontalAlignment="Left" Margin="350,80,0,0" Style="{DynamicResource Title0}" Text="Result" VerticalAlignment="Top"/>
        <Border Margin="350,109,40,40" BorderBrush="Silver" BorderThickness="2">
            <ScrollViewer CanContentScroll="True">
                <Grid>
                    <ContentControl Name="st" Content="{Binding StudentResult}" ContentTemplate="{StaticResource StudentResultTemplate}"
                         Visibility="{Binding IsInStudentMode, Converter={StaticResource BooleanToVisibilityConverter}}" />
                    <ContentControl Content="{Binding ClassResult}" ContentTemplate="{StaticResource ClassResultTemplate}"
                                Visibility="{Binding Visibility, ElementName=st, Converter={StaticResource InverseVisibilityConverter}}"/>
                </Grid>
            </ScrollViewer>
        </Border>
       
        
        
        




    </Grid>
</UserControl>
